import java.util.ArrayList;
public class Course {
    private String courseCode;
    private String courseName;
    private int creditHours;
    private ArrayList<String> enrolledStudents;
    public String getCourseName() {
        return courseName;
    }

    public Course(String courseCode, String courseName, int creditHours) {
        this.courseCode = courseCode;
        this.courseName = courseName;
        this.creditHours = creditHours;
        this.enrolledStudents = new ArrayList<>();
    }

    public Course(String courseCode, String courseName) {
        this(courseCode, courseName, 3); // Default credit hours are set to 3
    }

    public void enrollStudent(String studentName) {
        enrolledStudents.add(studentName);
        System.out.println(studentName + " has been enrolled in " + courseName);
    }

    public void printCourseInfo() {
        System.out.println("Course Code: " + courseCode);
        System.out.println("Course Name: " + courseName);
        System.out.println("Credit Hours: " + creditHours);
        System.out.println("Enrolled Students: " + enrolledStudents.size());
    }

    public void dropStudent(String studentName) {
        if (enrolledStudents.contains(studentName)) {
            enrolledStudents.remove(studentName);
            System.out.println(studentName + " has been dropped from " + courseName);
        } else {
            System.out.println(studentName + " is not enrolled in " + courseName);
        }
    }


}
